#!/usr/bin/python
# -*- coding: utf-8 -*-
# @version        : 1.0
# @Create Time    : 2024/9/6 11:11
# @File           : feature
# @IDE            : PyCharm
# @desc           : 描述

from sqlalchemy.orm import Mapped, mapped_column
from db.db_base import BaseModel, AuditModel
from sqlalchemy import String, Boolean, UniqueConstraint


class DCASRFeature(AuditModel):
    __tablename__ = "dc_check_asr_feature"
    __table_args__ = (
        UniqueConstraint(
            'part_no',
            'characteristic',
            'dimension',
            name="Idx_Part_Characteristic_Dimension"
        ),
        {'comment': 'ASR特征库'}
    )

    part_no: Mapped[str] = mapped_column(String(40), comment="材料/零件图号")
    characteristic: Mapped[str] = mapped_column(String(40), comment="特征")
    dimension: Mapped[str] = mapped_column(String(40), comment="尺寸")

    irr: Mapped[str] = mapped_column(String(10), comment="初始可靠值")
    grade: Mapped[str] = mapped_column(String(10), comment="等级")
    
    count: Mapped[str] = mapped_column(String(20), comment="特征计数")
